-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Conglomerated changes to optimize venv
usage in pipeline
#42486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request optimizes virtual environment usage in Azure DevOps pipelines by introducing UV (a fast Python package installer) as the preferred tool while maintaining fallbacks to traditional pip
commands. The changes streamline environment setup and package installation across the build pipeline.
Key changes:
- Integration of UV package manager with automatic fallback to pip when UV is unavailable
- Simplified virtual environment activation by removing manual activation scripts in favor of environment variables
- Addition of a new pipeline template for UV installation across different operating systems
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
eng/scripts/create-venv.ps1 | Added UV detection and usage for virtual environment creation with fallback to virtualenv |
eng/scripts/activate-venv.ps1 | Simplified activation by setting VIRTUAL_ENV and PATH variables instead of sourcing activation scripts |
eng/scripts/Language-Settings.ps1 | Added UV pip usage for package installations with fallback logic |
eng/pipelines/templates/steps/use-venv.yml | Integrated UV installation template into virtual environment setup |
eng/pipelines/templates/steps/seed-virtualenv-wheels.yml | Replaced pip with UV for virtualenv installation |
eng/pipelines/templates/steps/release-candidate-steps.yml | Removed manual activation scripts and switched to UV for dependency installation |
eng/pipelines/templates/steps/install-uv.yml | New template for cross-platform UV installation |
eng/pipelines/templates/steps/build-test.yml | Simplified by removing activation scripts and using UV for package installation |
eng/pipelines/templates/steps/build-package-artifacts.yml | Updated to use UV and removed activation script dependencies |
eng/pipelines/templates/steps/build-extended-artifacts.yml | Switched from pip to UV for dependency installation |
eng/pipelines/templates/steps/analyze.yml | Replaced pip with UV for tool installation |
Co-authored-by: Copilot <[email protected]>
@@ -8,8 +8,27 @@ parameters: | |||
- name: Condition | |||
type: string | |||
default: succeeded() | |||
- name: UseUv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't currently set UseUv
. So we can change this to default to false
at any time and use bog-standard pip
if we need to.
…lly remove a UsePython3.10 + install build tooling + SetTestPipeline + SetToxTargets. none of those are python 3.10 specific and can be moved to run on the same python version that is running in the build
/azp run python - core |
Azure Pipelines successfully started running 1 pipeline(s). |
Kicked |
This PR:
uv
to create this, with optional fallback tovirtualenv
.InstallUv
touse-venv.yml
template. Defaults totrue
. When present,uv
is installed, and variable$(PIP_EXE)
is set touv pip
. Ifuv
is not installed in this template,python -m pip
will be set instead.$(PIP_EXE)
wherever we used to callpython -m pip
. So far I've gone throughjobs/ci.yml
and any template that is referenced from that for my update.set python 310
,install azure-sdk-tools
, andset tox environments
. This script should run on any platform we support, so we moved it beneath the part of the template inbuild-tests.yml
. Look for the yml aroundSetTestPipeline
being moved.Impacts of using
uv
to improve install times are most visible here:On average we're shaving ~1 minute or more off of each job.